package com.thread.threadfirst.google.guava;


import com.google.common.util.concurrent.ThreadFactoryBuilder;

import javax.annotation.PostConstruct;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class SingleScheduledThread {

    @PostConstruct
    public void init(){
        ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(
                new ThreadFactoryBuilder().setNameFormat("Cache Service").build());

        executorService.scheduleWithFixedDelay(()->{
            if (true){
                List linkedList=new LinkedList();

            }

        },0,5000, TimeUnit.MILLISECONDS);
    }
}
